﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using Rison.BusinessFacade.Common;
using Rison.BusinessFacade.Entity.ZP;
using Rison.BusinessFacade.Helper;
using Rison.DataAccess.Common;
using Rison.DataAccess.Data.ZP;


namespace Rison.BusinessFacade.Facade.ZP
{
    public sealed class HistoryExamFacade 
    {
        
        public int InsertHistory(HistoryExam obj)
        {
            int returnValue= -1;
             
            StringBuilder param = new StringBuilder();
            StringBuilder field = new StringBuilder();

            field.Append("ID,ExamID,Type,DepartID,Year,ModifiedID,ModifiedName,ModifiedDate");

            param.Append("'" + obj.ID + "',");
            param.Append("'" + obj.ExamID + "',");
            param.Append("'" + obj.Type + "',");
            param.Append("'" + obj.DepartID + "',");
            param.Append("'" + obj.Year + "',");
            param.Append("'" + obj.ModifiedID + "',");
            param.Append("'" + obj.ModifiedName + "',");
            param.Append("'" + obj.ModifiedDate + "'");

            HistoryExamDB h = new HistoryExamDB();

            returnValue = h.InsertSubInfobyParentId(field.ToString(), param.ToString());
               
            return returnValue;
        }

        public DataSet GetInformation(string departid, string year)
        {
            if (departid == "")
                return null;

            HistoryExamDB h = new HistoryExamDB();
            return h.GetInformation(departid, year);
        }
    }
}
